import java.math.BigInteger;
import java.util.Arrays;
import java.util.Scanner;

import org.korifey.ffalg.NumberTheory;
import org.korifey.ffalg.Probabilities;


public class Problem25 {
	
	public static void main(String[] args) {
		System.out.println(solve());
	}
	static int n = 1000;
		
	public static long solve() {
		BigInteger a = BigInteger.ONE;
		BigInteger b = a;
		
		BigInteger max = BigInteger.TEN.pow(n-1);
		for (int i=3; ; i++) {
			BigInteger c = a.add(b);
			if (c.compareTo(max) >= 0) return i;
			a = b;
			b = c;
		}			
	}
	
}
